package demo;

import java.io.IOException;

import org.zkoss.zk.ui.Execution;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Session;
import org.zkoss.zk.ui.Sessions;
import org.zkoss.zk.ui.select.SelectorComposer;
import org.zkoss.zk.ui.select.annotation.Listen;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zul.Textbox;

public class LogIn extends SelectorComposer
{
	@Wire("textbox#usuario")
	Textbox usuario;
	
	@Wire("textbox#pass")
	Textbox password;
	
	
	
	@Listen("onClick = button#boton")
	public void logear(){
		//System.out.println(usuario.getText()+" "+password.getText());
		Session session = (Session)Sessions.getCurrent();
		session.setAttribute("nombre",usuario.getText());
		session.setAttribute("pass",password.getText());
		Executions.sendRedirect("/sesion.zul");
		
		
	}

}
